#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=10001;
struct node{
    int x,y;
    bool operator<(const node &xx) const{
        if(x!=xx.x)
        return x<xx.x;
        else return y<xx.y;
    }
}f[maxn];
int ans[maxn],cnt=0;
int main()
{
    int n;cin>>n;
    for(int i=1;i<=n;i++)
    cin>>f[i].x>>f[i].y;
    sort(f+1,f+n+1);
    int maxi=n;ans[cnt++]=n;
    for(int i=n-1;i>=1;i--)
    {
        if(f[i].y>f[maxi].y)
        {
            ans[cnt++]=i;
            maxi=i;
        }
    }
    cout<<"Number of maxima: "<<cnt<<endl;
    cout<<"Here are the maxima points:"<<endl;
    for(int i=cnt-1;i>=0;i--)
    cout<<"("<<f[ans[i]].x<<","<<f[ans[i]].y<<") ";
    return 0;
}